<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?php echo config('shopName');?> - 广告列表 </title>
    <link href="<?=ADMIN_CSS;?>/general.css" rel="stylesheet" type="text/css" />
    <link href="<?=ADMIN_CSS;?>/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>
    <span class="action-span"><a href="<?php echo url("Admin/Ad/add")?>">添加广告</a></span>
    <span class="action-span1"><a href="<?php echo url("Admin/Index/main")?>"><?php echo config('shopName');?></a></span>
    <span id="search_id" class="action-span1"> -广告列表 </span>
    <div style="clear:both"></div>
</h1>
<div class="form-div">
    <form action="<?php echo url('Admin/Ad/lst');?>" name="searchForm" method="get">
        <img src="<?=ADMIN_IMG?>/icon_search.gif" width="26" height="22" border="0" alt="search" />
        <input type="text" name="keyword" size="50" placeholder="广告名称" value="<?php echo $keyword?>" autocomplete="off" />
        <input type="submit" value=" 搜索 " class="button" />
    </form>
</div>
<div class="list-div" id="listDiv">
    <table cellpadding="3" cellspacing="1">
        <tr>
            <th>编号</th>
            <th>广告名称</th>
            <th>广告位置</th>
            <th>广告URL</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>排序</th>
            <th>操作</th>
        </tr>
        <?php $adposModel = model('AdPosition'); foreach ($ad as $k=>$v):?>
            <tr>
                <td>
                    <?php echo $v["id"]?>
                </td>
                <td>
                    <?php echo $v["ad_name"]?>
                </td>
                <td>
                    <?php $adInfo = $adposModel->getAdPositionInfoByAdId($v["adpos_id"]);?>
                    <?php echo $adInfo["adpos_name"]?>( <?php echo $adInfo["adpos_width"]?> *<?php echo $adInfo["adpos_height"]?>px)
                </td>
                <td>
                    <?php echo $v["ad_url"]?>
                </td>
                <td align="center">
                    <?php echo$v["start_time"]?>
                </td>
                <td align="center"><?php echo $v["end_time"];?></td>
                <td align="center"><?php echo $v["show_order"];?></td>
                <td align="center">
                    <a href="<?php echo url("Admin/Ad/save",array('id'=>$v['id']))?>" title="编辑">编辑</a> |
                    <a onclick="return confirm('确定要删除吗');" href="<?php echo url("Admin/Ad/delete",array('id'=>$v['id']))?>" title="删除">移除</a>
                </td>
            </tr>
        <?php endforeach;?>
        <tr>
            <td align="center" nowrap="true" colspan="8">
                <?php echo $page;?>
            </td>
        </tr>
    </table>
</div>

<?php require_once  resource_path('view/public/footer.php');?>
</body>
</html>